﻿src="~/Scripts/jquery.signalR-1.0.1.js"
src="~/signalr/hubs"

        $(function () {          
            var chat = $.connection.chatHub;
            chat.client.addNewMessageToPage = function (name, message) {
                $('#discussion').append('<li><strong>' + htmlEncode(name) 
                    + '</strong>: ' + htmlEncode(message) + '</li>');
            };
            $('#displayname').val(prompt('Enter your name:', ''));
            $('#chatmessage').focus();
            $.connection.hub.start().done(function () {
                $('#sendmessage').click(function () {
                    chat.server.send($('#displayname').val(), $('#message').val()); 
                    $('#chatmessage').val('').focus();
                });
            });
        });
    function htmlEncode(value) {
        var encodedValue = $('<div />').text(value).html();
        return encodedValue;
    }


